import java.util.Scanner;
public class PrimeNumber {
	public static void main(String[] args) {
		Scanner sc=new Scanner(System.in);
		System.out.println("请输入n的值：");
		int n=sc.nextInt();
		System.out.println(n+"内的素数为：");
		loop: for (int i = 2; i < n; i++) {
			for (int j = 2; j < i; j++) {
				if (i % j == 0) {
					continue loop;
				}
			}
			System.out.print(" " + i);
		}
	}
}
